package info.mhylle.mediaplayer.data.model;

import java.util.Set;


public class Album {
    private long albumId = 0;
    private String artistName = "";
    private String albumName = "";
    private int releaseyear = 0;

    private Set<Track> tracks = new java.util.HashSet<Track>();

    public int getReleaseyear() {
        return releaseyear;
    }

    public void setReleaseyear(int releaseyear) {
        this.releaseyear = releaseyear;
    }


    public String getArtistName() {
        return artistName;
    }

    public void setArtistName(String artistName) {
        this.artistName = artistName;
    }

    public String getAlbumName() {
        return albumName;
    }

    public void setAlbumName(String albumName) {
        this.albumName = albumName;
    }

    public long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    public Set<Track> getTracks() {
        return tracks;
    }

    public void setTracks(Set<Track> tracks) {
        if (tracks != null) {
            this.tracks = tracks;
        }
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Album)) return false;

        Album album = (Album) o;

        if (albumId != album.albumId) return false;
        if (releaseyear != album.releaseyear) return false;
        if (albumName != null ? !albumName.equals(album.albumName) : album.albumName != null) return false;
        if (artistName != null ? !artistName.equals(album.artistName) : album.artistName != null) return false;
        if (tracks != null ? !tracks.equals(album.tracks) : album.tracks != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (int) (albumId ^ (albumId >>> 32));
        result = 31 * result + (artistName != null ? artistName.hashCode() : 0);
        result = 31 * result + (albumName != null ? albumName.hashCode() : 0);
        result = 31 * result + releaseyear;
        result = 31 * result + (tracks != null ? tracks.hashCode() : 0);
        return result;
    }
}
